# demo03_dict.py
dict01 = {"niu": 100, "zhang": 200}
# print(dict01[0])  # KeyError: 0
print(len(dict01))
print("niu" in dict01)  # True, 判断某一个key在不在字典当中
print(dict01["zhang"])  # 通过key查询对应的value
dict01["zhang"] = 201  # 对已有key的value进覆盖是修改操作
dict01["li"] = 300  # 对原字典中不存在的key设置value是添加操作
print(dict01)



